package com.msw.design.proxy.statics;

/**
 * Created by minshiwu on 2017/6/4.
 */
public class ProxySubject implements Subject {

    private Subject subject;


    public ProxySubject(Subject subject) {
        this.subject = subject;
    }

    @Override
    public String request(String param) {
        preHandle();
        String res = this.subject.request(param);
        postHadle();
        return res;
    }


    public void preHandle() {
        // todo some magic
        System.out.println("before method invoke .............");
    }


    public void postHadle() {
        // todo  do some magic
        System.out.println("after method invoke .............");
    }


}
